import Vue from 'vue'
import VueRouter from 'vue-router'
import store from './store'

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: "/game",
  },
  {
    path: "/about",
    name: "About",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/About.vue"),
  },
  {
    path: "/pass",
    name: "供你已关卡",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/pass.vue"),
  },
  {
    path: "/game/index",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/index.vue"),
  },
  {
    path: "/hexiao",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/hexiao.vue"),
  },
  {
    path: "/award",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/award.vue"),
  },
  {
    path: "/awardno",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/awardno.vue"),
  },
  {
    path: "/game",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game.vue"),
  },
  {
    path: "/game1",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game1.vue"),
  },
  {
    path: "/game2",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game2.vue"),
  },
  {
    path: "/game3",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game3.vue"),
  },
  {
    path: "/game4",
    name: "脑洞小游戏",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game4.vue"),
  },
  {
    path: "/game5",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game5.vue"),
  },
  {
    path: "/game6",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game6.vue"),
  },
  {
    path: "/game7",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game7.vue"),
  },
  {
    path: "/game8",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game8.vue"),
  },
  {
    path: "/game9",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game9.vue"),
  },
  {
    path: "/game10",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game10.vue"),
  },
  {
    path: "/game11",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game11.vue"),
  },
  {
    path: "/game12",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game12.vue"),
  },
  {
    path: "/game13",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game13.vue"),
  },
  {
    path: "/game14",
    component: () =>
      import(/* webpackChunkName: "about" */ "./views/case/game/game14.vue"),
  },
  // {
  //   path: "/wrapper",
  //   component: () =>
  //     import(/* webpackChunkName: "about" */ "./components/Wrapper"),
  //   children: [{
  //       path: "/case",
  //       name: "Case",
  //       component: Case,
  //       meta: { isShowTabbar: true }
  //     }, {
  //       path: "/manage",
  //       name: "Manage",
  //       component: () =>
  //         import(/* webpackChunkName: "manage" */ "./views/manage/Manage.vue"),
  //       meta: { isShowTabbar: true }
  //     }, {
  //       path: "/fans",
  //       name: "Fans",
  //       component: () =>
  //         import(/* webpackChunkName: "fans" */ "./views/fans/Fans.vue"),
  //       meta: { isShowTabbar: true }
  //     }, {
  //       path: "/my",
  //       name: "My",
  //       component: () =>
  //         import(/* webpackChunkName: "my" */ "./views/my/My.vue"),
  //       meta: { isShowTabbar: true }
  //     }
  //   ],
  // },
];

const router = new VueRouter({
  routes
})
// 路由守卫
router.beforeEach((to,from,next)=>{
  // if(!to.meta.isShowTabbar) {
  //   document.title = to.name;
  // }
  
  next();
  // store.commit("setIsPass",false)
  // console.log("isPass",store.state.isPass)
  // if(to.matched.some(res=>res.meta.isLogin)){//判断是否需要登录
  //     if (sessionStorage['username']) {
  //         next();
  //     }else{
  //         next({
  //             path:"/login",
  //             query:{
  //                 redirect:to.fullPath
  //             }
  //         });
  //     }

  // }else{
  //     next()
  // }
});
export default router
